<template>
  <div class="dashboard-container">
    <el-row :gutter="20">
      <el-col :span="12" :xs="24">
        <el-card class="box-card">
          <div slot="header" class="clearfix"><span>个人信息</span></div>
          <div>
            <div class="text-center">
              <div>
                <div class="user-avatar">
                  <img v-if="options.img" :src="img_src(options.img)" @click="editCropper()" title="点击上传头像" class="img-circle img-lg" />
                  <img v-else src="@/assets/image/user_default.png" class="img-circle img-lg" />
                  <!-- <img src="@/assets/image/user_default.png" class="img-circle img-lg" /> -->
                </div>
                <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body><UploaderAvatar @backUploaderAvatar="backUploaderAvatar" /></el-dialog>
              </div>
            </div>
            <ul class="list-group list-group-striped">
              <li class="list-group-item">
                <svg-icon icon-class="user" />
                用户名称
                <div class="pull-right">{{ user.username }}</div>
              </li>
              <li class="list-group-item">
                <svg-icon icon-class="phone" />
                手机号码
                <div class="pull-right">{{ user.telephone }}</div>
              </li>
              <li class="list-group-item">
                <svg-icon icon-class="email" />
                用户邮箱
                <div class="pull-right">{{ user.e_mail }}</div>
              </li>
              <li class="list-group-item">
                <svg-icon icon-class="peoples" />
                所属角色
                <div class="pull-right">{{ user.rolename }}</div>
              </li>
              <li class="list-group-item">
                <svg-icon icon-class="date" />
                创建日期
                <div class="pull-right">{{ user.register_time }}</div>
              </li>
            </ul>
          </div>
        </el-card>
      </el-col>
      <el-col :span="12" :xs="24">
        <el-card>
          <el-tabs v-model="activeTab">
            <el-tab-pane label="修改密码" name="resetPwd">
              <el-form ref="form" :model="user" :rules="rules" label-width="80px">
                <el-form-item label="旧密码" prop="oldPassword"><el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" /></el-form-item>
                <el-form-item label="新密码" prop="newPassword"><el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" /></el-form-item>
                <el-form-item label="确认密码" prop="confirmPassword"><el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" /></el-form-item>
                <el-form-item>
                  <el-button type="primary" size="mini" @click="submit">保存</el-button>
                  <el-button type="danger" size="mini" @click="close">关闭</el-button>
                </el-form-item>
              </el-form>
            </el-tab-pane>
          </el-tabs>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
<script src="./index.js"></script>
<style lang="scss" scoped src="./index.scss"></style>
